/*package com.hy.mydesktop.client.mvc.dataload;

import java.util.HashMap;
import java.util.Map;

import java_cup.internal_error;

import com.extjs.gxt.desktop.client.Desktop;
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BaseModel;
import com.extjs.gxt.ui.client.mvc.AppEvent;
import com.extjs.gxt.ui.client.mvc.Dispatcher;
import com.extjs.gxt.ui.client.widget.Component;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.menu.MenuBar;
import com.hy.mydesktop.client.MyDesktop;
import com.hy.mydesktop.client.component.event.AppEvents;
import com.hy.mydesktop.client.component.factory.GxtComponentFactory;
import com.hy.mydesktop.client.component.mvc.event.EventStructureMetaModel;
import com.hy.mydesktop.client.mvc.base.BaseController;
import com.hy.mydesktop.client.mvc.grid.GridSetModule;
import com.hy.mydesktop.client.mvc.menubar.MenuBarDisplay;
import com.hy.mydesktop.client.mvc.menubar.MenuBarPresenter;
import com.hy.mydesktop.client.mvc.util.ControllerUtil;
import com.hy.mydesktop.shared.util.log.MyLoggerUtil;

*//**
 * 
 * <ul>
 * <li>开发作者：花宏宇</li>
 * <li>设计日期：2010-9-29；时间：下午04:09:35</li>
 * <li>类型名称：DataLoadController</li>
 * <li>设计目的：对于所有控件、组件的数据加载问题统一处理</li>
 * </ul>
 * <ul>
 * <b>修订编号：</b>
 * <li>修订日期：</li>
 * <li>修订作者：</li>
 * <li>修订原因：</li>
 * <li>修订内容：</li>
 * </ul>
 *//*
public class GridDataLoadController extends BaseController {

	private GridDataLoadPresenter gridDataLoadPresenter;
	//private GridDataLoadPresenter gridDataLoadPresenterlllll;

	
	public GridDataLoadController() {
		
		super();
		super.printControllerForInit(getClass());
	}

	@Override
	public void handleEvent(AppEvent event) {
		
		//shortcutView.getShortcut()??
		EventStructureMetaModel eventStructureMetaModel = null;
		Object object =((Map<String, Object>)event.getData()).get("eventstructuremetamodel");
		eventStructureMetaModel = (EventStructureMetaModel)object;
		
		Map<String, Object> map = (Map<String, Object>)event.getData();
		int i=1;
		i=2;
		//EventStructureMetaModel eventStructureMetaModel =(EventStructureMetaModel)map.get("eventstructuremetamodel");
		EventStructureMetaModel eventStructureMetaModel =(EventStructureMetaModel)((Map<String, Object>)event.getData()).get("eventstructuremetamodel");
		//0401
		if (AppEvents.LOAD_DATA_EVENT==event.getType()) {
			//通过EventStructureMetaModel识别，是否应该处理该事件
//			if (eventStructureMetaModel==null||eventStructureMetaModel.getControllerId()==null||eventStructureMetaModel.getControllerId()==this.getId()) {
			if (ControllerUtil.isHandle(eventStructureMetaModel, this)) {
				*//**
				 * event中需要包含的内容
				 * 需要被加载数据的是哪个控件
				 * 这个控件是那种类型Grid还是Tree
				 * 该如何加载数据（eg：需要哪些标识）
				 *//*
				forwardToView(gridDataLoadPresenter, event);
				
			}
		}
		//0601
		 if (AppEvents.GRID_RELOAD==event.getType()) {
			if (ControllerUtil.isHandle(eventStructureMetaModel, this)) {
				
				forwardToView(gridDataLoadPresenter, event);
				
			}
		}
		

		//0305
		else if (AppEvents.FORM_FIELD_DATALOAD==event.getType()) {
			//if (eventStructureMetaModel==null||this.getId()==null||eventStructureMetaModel.getControllerId()==null||eventStructureMetaModel.getControllerId().equals(this.getId())) {
			if (ControllerUtil.isHandle(eventStructureMetaModel, this)) {
			
			
					String dataObjectId = (String)map.get("dataObjectId");		
					BaseModel formData = (BaseModel)map.get("formData");		
					
					//String fieldValue = formData.get(property);

					String fieldId = textFieldView.getTextField().getData("id");
					int firstIndex = fieldId.indexOf(".");
					
					String fieldPropertId = fieldId.substring(firstIndex+1);
					
					formData.get(fieldPropertId);
														
					//转发到视图View
				forwardToView(gridDataLoadPresenter, event);			
								

			}else {
				this.forwardToChild(event);

			}		
		}
		
		//0000
		//如果当前控制器，不能处理该事件，则向下转发
		else {
			this.forwardToChild(event);
		}
		*//**
		 * 将事件转发给子节点，及子控制器
		 * 注:当前控制器，含有子节点的时候，必不可少
		 *//*
		//this.forwardToChild(event);
		枚举每一个可能需要响应的事件，以及其需要的处理方式
		ifelse switch (key) {
			case value:
				
				break;

			default:
				break;
		}
	}
	
	public void initialize() {
				 
		GridSetModuleDiplay display = new GridSetModuleDiplay(new GridSetModule());
		  gridDataLoadPresenter = new GridDataLoadPresenter(this,display);
		 
	  }
	
	protected void onError(AppEvent ae) {
	    System.out.println("error: " + ae.<Object>getData());
	  }
}*/
